﻿@model ManageReportVer1.Models.User

@{
    ViewBag.Title = "UpdateUser";
    Layout = "~/Views/Shared/_LayoutSecurityGuard.cshtml";
}
<div id="breadcrumb">
    @Html.ActionLink("Quản lý người dùng", "ViewUsers", "Account") >
    Cập nhật tài khoản
</div>

<h2>Cập nhật tài khoản</h2>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>Cập nhật thông tin người dùng</legend>

        @Html.HiddenFor(model => model.UserId)

        <div class="row">
            @Html.LabelFor(model => model.Password)
        
            <div class="inputs">
                @Html.EditorFor(model => model.Password, new { @readonly = "readonly" })
                @Html.ValidationMessageFor(model => model.Password)
            </div>
            </div>

        <div class="row">
            @Html.LabelFor(model => model.Email)
        
        <div class="inputs">
            @Html.EditorFor(model => model.Email)
            @Html.ValidationMessageFor(model => model.Email)
        </div>
            </div>

        <div class="row">
            @Html.LabelFor(model => model.PasswordQuestion)
        
       <div class="inputs">
            @Html.EditorFor(model => model.PasswordQuestion)
            @Html.ValidationMessageFor(model => model.PasswordQuestion)
        </div>
            </div>

        <div class="row">
            @Html.LabelFor(model => model.PasswordAnswer)
        
        <div class="inputs">
            @Html.EditorFor(model => model.PasswordAnswer)
            @Html.ValidationMessageFor(model => model.PasswordAnswer)
        </div>
            </div>

        <div class="row">
            @Html.LabelFor(model => model.IsApproved)
        
        <div class="inputs">
            @Html.EditorFor(model => model.IsApproved)
            @Html.ValidationMessageFor(model => model.IsApproved)
        </div>
            </div>

       @* <div class="row">
            @Html.LabelFor(model => model.IsLockedOut)
        
        <div class="inputs">
            @Html.EditorFor(model => model.IsLockedOut)
            @Html.ValidationMessageFor(model => model.IsLockedOut)
        </div>
            </div>

        <div class="row">
            @Html.LabelFor(model => model.CreateDate)
        
        <div class="inputs">
            @Html.EditorFor(model => model.CreateDate)
            @Html.ValidationMessageFor(model => model.CreateDate)
        </div>
            </div>

        <div class="row">
            @Html.LabelFor(model => model.LastLoginDate)
        
        <div class="inputs">
            @Html.EditorFor(model => model.LastLoginDate)
            @Html.ValidationMessageFor(model => model.LastLoginDate)
        </div>
            </div>

        <div class="row">
            @Html.LabelFor(model => model.LastPasswordChangedDate)
        
        <div class="inputs">
            @Html.EditorFor(model => model.LastPasswordChangedDate)
            @Html.ValidationMessageFor(model => model.LastPasswordChangedDate)
        </div>
            </div>

        <div class="row">
            @Html.LabelFor(model => model.LastLockoutDate)
        
        <div class="inputs">
            @Html.EditorFor(model => model.LastLockoutDate)
            @Html.ValidationMessageFor(model => model.LastLockoutDate)
        </div>
            </div>

        <div class="row">
            @Html.LabelFor(model => model.FailedPasswordAttemptCount)
        
        <div class="inputs">
            @Html.EditorFor(model => model.FailedPasswordAttemptCount)
            @Html.ValidationMessageFor(model => model.FailedPasswordAttemptCount)
        </div>
            </div>

        <div class="row">
            @Html.LabelFor(model => model.FailedPasswordAttemptWindowStart)
        
        <div class="inputs">
            @Html.EditorFor(model => model.FailedPasswordAttemptWindowStart)
            @Html.ValidationMessageFor(model => model.FailedPasswordAttemptWindowStart)
        </div>
            </div>

        <div class="row">
            @Html.LabelFor(model => model.FailedPasswordAnswerAttemptCount)
       
        <div class="inputs">
            @Html.EditorFor(model => model.FailedPasswordAnswerAttemptCount)
            @Html.ValidationMessageFor(model => model.FailedPasswordAnswerAttemptCount)
        </div>
             </div>

        <div class="row">
            @Html.LabelFor(model => model.FailedPasswordAnswerAttemptWindowsStart)
        
        <div class="inputs">
            @Html.EditorFor(model => model.FailedPasswordAnswerAttemptWindowsStart)
            @Html.ValidationMessageFor(model => model.FailedPasswordAnswerAttemptWindowsStart)
        </div>
            </div>*@

        <div class="row">
            @Html.LabelFor(model => model.Comment)
       <div class="inputs">
            @Html.EditorFor(model => model.Comment)
            @Html.ValidationMessageFor(model => model.Comment)
        </div>
            </div>

        <div class="row">
            @Html.LabelFor(model => model.DepartmentId)
        <div class="inputs">
            @Html.EditorFor(model => model.DepartmentId)
            @Html.ValidationMessageFor(model => model.DepartmentId)
        </div>
              </div>

        <div class="row">
            @Html.LabelFor(model => model.FirstName)
        <div class="inputs">
            @Html.EditorFor(model => model.FirstName)
            @Html.ValidationMessageFor(model => model.FirstName)
        </div>
            </div>
        <div class="row">
            @Html.LabelFor(model => model.LastName)
        
        <div class="inputs">
            @Html.EditorFor(model => model.LastName)
            @Html.ValidationMessageFor(model => model.LastName)
        </div>
            </div>

        <div class="row">
            @Html.LabelFor(model => model.UserName)
        
        <div class="inputs">
            @Html.EditorFor(model => model.UserName)
            @Html.ValidationMessageFor(model => model.UserName)
        </div>
            </div>

        <div class="row">
            @Html.LabelFor(model => model.Honorary)
        <div class="inputs">
            @Html.EditorFor(model => model.Honorary)
            @Html.ValidationMessageFor(model => model.Honorary)
        </div>
             </div>
        <div class="row">
            @Html.LabelFor(model => model.Address)
        
        <div class="inputs">
            @Html.EditorFor(model => model.Address)
            @Html.ValidationMessageFor(model => model.Address)
        </div>
            </div>

        <div class="row">
            @Html.LabelFor(model => model.Telephone)
        
        <div class="inputs">
            @Html.EditorFor(model => model.Telephone)
            @Html.ValidationMessageFor(model => model.Telephone)
        </div>
            </div>

        <div class="row">
            @Html.LabelFor(model => model.NickName)
        
        <div class="inputs">
            @Html.EditorFor(model => model.NickName)
            @Html.ValidationMessageFor(model => model.NickName)
        </div>
            </div>

        <div class="row">
            @Html.LabelFor(model => model.DateOfBirth)
        
        <div class="inputs">
           @* @Html.EditorFor(model => model.DateOfBirth.Date, String.Format("{0:d}", Model.DateOfBirth.Date))*@
            @Html.EditorFor(model => model.DateOfBirth)
            @Html.ValidationMessageFor(model => model.DateOfBirth)
        </div>
            </div>

        <div class="row">
            @Html.LabelFor(model => model.Gender)
        
        <div class="inputs">
            @Html.EditorFor(model => model.Gender)
            @Html.ValidationMessageFor(model => model.Gender)
        </div>
            </div>

        <div class="row">
            @Html.LabelFor(model => model.MaritalStatus)
        
        <div class="inputs">
            @Html.EditorFor(model => model.MaritalStatus)
            @Html.ValidationMessageFor(model => model.MaritalStatus)
        </div>
            </div>

        <div class="row">
            @Html.LabelFor(model => model.Photo)
        
        <div class="inputs">
            @Html.EditorFor(model => model.Photo)
            @Html.ValidationMessageFor(model => model.Photo)
        </div>
        </div>

        <div class="row">
            @Html.LabelFor(model => model.RoleId)
        
        <div class="inputs">
            @Html.EditorFor(model => model.RoleId)
            @Html.ValidationMessageFor(model => model.RoleId)
        </div>
            </div>
        <div class="row">
            <p>
                <input type="submit" value="Cập nhật thông tin" />
            </p>
        </div>
    </fieldset>
}
<div class="backToView">
    @Html.ActionLink("Quay lại danh sách người dùng", "ViewUsers")
</div>

@*@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}*@
<script type="text/javascript">
    $(document).ready(function () {
     //   $("#DateOfBirth_Date").text().hide();

        //get
       var bla = $('input[id=DateOfBirth]').val();
      // alert(bla.substring(0,10));
       
        //set
       $('input[id=DateOfBirth]').val(bla.substring(0, 10));
       // $('input[id=DateOfBirth_Date]').val('bla');
    //    alert($('input[id=DateOfBirth_Date]').val('bla'));
    });
</script>